package joomz;

import javax.script.Bindings;

/**
 * Location fixtures
 */
public class Object
    extends Abstract
    implements Enumerated.Member
{
    public final static Enumerated<Object> Set = new Enumerated<Object>();

    public final static Object Dereference(String id){
        Object re = Set.forName(id);
        if (null != re)
            return re;
        else {
            re = new Object();
            re.setId(id);
            Set.register(re);
            return re;
        }
    }


    public Object(){
        super();
    }

    public void init(Bindings bindings){
        Set.register(this);
    }
    public boolean isValid(){
        if (null != this.id)
            return true;
        else
            throw new Game.Invalid("Object missing ID.");
    }
}
